home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 2.2 KB | 72 lines | [TEXT/MPS ] |
- // UPointerObject.h
- // Copyright © 1984-96 by Apple Computer, Inc. All rights reserved.
-
- #ifndef __UPOINTEROBJECT__
- #define __UPOINTEROBJECT__
-
- // MacApp
-
- #ifndef __MACONDITIONALMACROS__
- #include "MAConditionalMacros.h"
- #endif
-
- // Toolbox
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- // ANSI
-
- #ifndef __STDDEF__
- #include <stddef.h>
- #endif
-
-
- //----------------------------------------------------------------------------------------
- // Forward class declarations
- //----------------------------------------------------------------------------------------
-
- class TObject;
-
- //----------------------------------------------------------------------------------------
- // Global function declarations
- //----------------------------------------------------------------------------------------
-
- void* MAOperatorNew(size_t size);
- // Allocate space for an object in the global object heap.
-
- void MAOperatorDelete(void* obj);
- // Delete an object from the global object heap.
-
- Boolean VerboseIsObject(TObject *obj);
- // Debugging check. Indicate whether the parameter appears to really be an object and
- // emit diagnostics if it is not
-
- Boolean AllocateObjectsFromPerm(Boolean allocateFromPerm);
- // Set to true to make object allocation calls use Permanent memory (the default). Set
- // to false to make object allocation calls use temporary memory (if they cannot be
- // allowed to fail). Returns old state.
-
- Boolean GetPermObjectAllocationState();
- // Return the state of object allocation. True for permanent, false for temporary.
-
- void FailNonObject(TObject* obj);
- // Invokes failure if parameter is not IsObject
-
- TObject* FreeIfObject(TObject* obj);
- // IF obj <> NULL THEN obj->Free; useful for freeing an object that might sometimes be
- // NULL. NULL Function result is handy for assigning back to the reference just freed
- // (to help allieviate dangling pointerciples)
-
- void InitUObject();
- // Essential one time initialization for this unit
-
- Boolean IsObject(TObject* obj);
- // Debugging check. Returns true if obj references something that looks like a real
- // object, false if obj is NULL or a non-object reference. This is not an absolutely
- // sure-fire test of objectness. When debugging is off, it is just a check if the
- // reference is not NULL.
-
- #endif
-